<template>
	<view class="footer">
		<view class="item" @click="redirect(0)">
			<image :src="`${baseImageUrl}/tabbar/tabbar2.png`" v-if="active==0"></image>
			<image :src="`${baseImageUrl}/tabbar/tabbar1.png`" v-else></image>
		</view>
		<view class="item" @click="redirect(1)">
			<image :src="`${baseImageUrl}/tabbar/tabbar4.png`" v-if="active==1"></image>
			<image :src="`${baseImageUrl}/tabbar/tabbar3.png`" v-else></image>
		</view>
		<view class="item" @click="redirect(2)">
			<image :src="`${baseImageUrl}/tabbar/tabbar6.png`" v-if="active==2"></image>
			<image :src="`${baseImageUrl}/tabbar/tabbar5.png`" v-else></image>
		</view>
		<!-- <view class="item" @click="redirect(3)">
			<image :src="`${baseImageUrl}/tabbar/tabbar8.png`" v-if="active==3"></image>
			<image :src="`${baseImageUrl}/tabbar/tabbar7.png`" v-else></image>
		</view> -->
		<view class="item" @click="redirect(3)">
			<image :src="`${baseImageUrl}/tabbar/tabbar10.png`" v-if="active==3"></image>
			<image :src="`${baseImageUrl}/tabbar/tabbar9.png`" v-else></image>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			active: {
				type: String,
				default: "0"
			}
		},
		methods: {
			redirect(number) {
				this.$store.commit('changeTabbarIndex', number);
				this.redirectRouter(number);
			}
		}
	}
</script>

<style scoped lang="scss">
	.footer {
		width: 100%;
		height: $tabbarFooterHeihgt;
		padding: 0 45rpx;
		box-sizing: border-box;
		background: url(#{$baseImageUrl}/home/tab_bg.png) no-repeat;
		background-size: 100% 100%;
		display: flex;
		justify-content: space-between;

		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 999999;

		.item {
			image {
				width: 120rpx;
				height: 120rpx;
			}
		}
	}
</style>